package com.fuhao.controller;

import com.fuhao.dao.UserMapper;
import com.fuhao.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhang
 * @title: IndexController
 * @projectName springactivemq
 * @description: TODO
 * @date 2019/5/1415:56
 */
@RestController
public class IndexController {

    @Autowired
    private UserMapper userMapper;

    @RequestMapping("/")
    public String index(){
        return "index";
    }

    @RequestMapping("/user")
    public List<User> getUser(){
        List<User> users = userMapper.selectList(null);
        return users ;
    }
}
